<form id="feedbackForm" class="form-horizontal" action="${ctx}/admin/feedback/save.do"  method="post">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h5 class="blue">回复反馈</h5>
    </div>
    <div class="modal-body">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="id">反馈编号:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="id" id="id" readonly=""  value="${feedback.id!}"/>
                </div>
            </div>
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="userId">用户编号:</label>
            <div class="col-xs-12 col-sm-3">
                <div class="clearfix">
                    <input type="text" name="userId" readonly=""  id="userId"  value="${feedback.userId!}"/>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="userName">用户名称:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="userName" readonly=""  id="userName"  value="${feedback.userName!}"/>
                </div>
            </div>
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="contact">联系方式:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="contact" readonly=""  id="contact"  value="${feedback.contact!}"/>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="email">用户邮箱:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="email" readonly=""  id="email"  value="${feedback.email!}"/>
                </div>
            </div>
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="phoneModel">手机型号:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="phoneModel" readonly=""  id="phoneModel" value="${feedback.phoneModel!}"/>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="phoneSDK">手机固件版本:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="phoneSDK" readonly=""  id="phoneSDK" value="${feedback.phoneSDK!}"/>
                </div>
            </div>
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="marketVersion">软件版本:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="marketVersion" readonly=""  id="marketVersion" value="${feedback.marketVersion!}"/>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="netType">网络类型:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="netType" readonly=""  id="netType" value="${feedback.netType!}"/>
                </div>
            </div>
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="createTimeShow">创建时间:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="createTimeShow" readonly=""  id="createTimeShow"  value="${feedback.createTimeShow!}"/>
                    <input type="hidden" name="createTime" readonly=""  id="createTime"  value="${feedback.createTime!}"/>
                </div>
            </div>
        </div>

        <#if feedback.replyContent??>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="replyTimeShow">回复时间:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="replyTimeShow" readonly=""  id="replyTimeShow"  value="${feedback.replyTimeShow!}"/>
                    <input type="hidden" name="replyTime" readonly=""  id="replyTime"  value="${feedback.replyTime!}"/>
                </div>
            </div>
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="adminId">回复管理员:</label>
            <div class="col-xs-12 col-sm-4">
                <div class="clearfix">
                    <input type="text" name="adminId" readonly=""  id="adminId" value="${feedback.adminId!}"/>
                </div>
            </div>
        </div>
        </#if>
        <!--状态-->
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2 no-padding-right">状态:</label>
            <div class="col-xs-12 col-sm-4" >
                <div class="clearfix">
                    <input type="text" name="status" readonly=""  id="status" class="col-xs-12 col-sm-4 " value="${feedback.status!}"/>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="content">反馈内容:</label>
            <div class="col-xs-12 col-sm-10">
                <div class="clearfix">
                    <textarea class=" col-sm-10 limited " readonly=""  id="content" name="content" >${feedback.content!}</textarea>
                </div>
            </div>
        </div>

        <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="replyContent">回复内容:</label>
        <div class="col-xs-12 col-sm-10">
            <div class="clearfix">
                <textarea class=" col-sm-10 limited required" id="replyContent" name="replyContent" >${feedback.replyContent!}</textarea>
            </div>
        </div>
    </div>

    </div>

    <div class="modal-footer center">
        <#if feedback.status == 0>
            <button type="submit" class="btn btn-sm btn-success"><i class="ace-icon fa fa-check"></i> 回复</button>
        </#if>
        <button type="button" class="btn btn-sm" data-dismiss="modal"><i class="ace-icon fa fa-times"></i> 取消</button>
    </div>
</form>
<script src="${ctx}/static/admin/assets/js/jquery.validate.js"></script>
<script src="${ctx}/static/admin/assets/js/jquery.validate.messages_zh.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $(".date-picker").datepicker({
            language : 'zh-CN',
            autoclose: true,
            todayHighlight: true
        });

        $("#feedbackForm").validate({
            errorElement: 'div',
            errorClass: 'help-block',
            focusInvalid: true,
            highlight: function (e) {
                $(e).closest('.form-group').removeClass('has-info').addClass('has-error');
            },
            success: function (e) {
                $(e).closest('.form-group').removeClass('has-error');//.addClass('has-info');
                $(e).remove();
            },
            errorPlacement: function (error, element) {
                if(element.is('input[type=checkbox]') || element.is('input[type=radio]')) {
                    var controls = element.closest('div[class*="col-"]');
                    if(controls.find(':checkbox,:radio').length > 1) controls.append(error);
                    else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));
                }
                else if(element.is('.select2')) {
                    error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));
                }
                else if(element.is('.chosen-select')) {
                    error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));
                }
                else error.insertAfter(element.parent());
            },

            submitHandler: function (form) {
                $.ajax({
                    cache: true,
                    type: "POST",
                    url:"${ctx}/admin/feedback/save.do",
                    data:$('#feedbackForm').serialize(),// 你的formid
                    async: true,
                    error: function(request) {
                        alert("Connection error");
                    },
                    success: function(data) {
                        if(data.result == "success"){
                            window.location="${refer!}";
                        }else{
                            alert(msg.messages);
                        }
                    }
                });
            },
            invalidHandler: function (form) {
            }
        })
    });
</script>